
import os
import random
from tqdm import tqdm
import shutil
import os.path
mix_path = r'/home/xys/CloundShiProjects/test_result/'  #jpg和txt混合路径
jpg_path = r'/home/xys/CloundShiProjects/traffic_light/qixian_test/'     #txt保存路径
save_jpg_path = r'/home/xys/CloundShiProjects/traffic_light/trafficlight_classify/qixian_test/jpg/'       #图片路径
save_txt_path = r'/home/xys/CloundShiProjects/traffic_light/trafficlight_classify/qixian_test/txt/'

files = os.listdir(mix_path)
for file in tqdm(files):
    file_back = file[-4:]
    file_front = file[:-4]
    if file_back == ".jpg":
        shutil.copy(os.path.join(jpg_path, file), save_jpg_path)
    else:
        shutil.copy(mix_path + file, save_txt_path)



